import {
  Entity, PrimaryGeneratedColumn, Column,
} from 'typeorm';

@Entity('struct_user')
export class StructUserEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
  })
  id: number;

  @Column('int', {
    nullable: true,
    name: 'struct_id',
  })
  structId: number | null;

  @Column('int', {
    nullable: true,
    name: 'user_id',
  })
  userId: number | null;

  @Column('timestamp', {
    nullable: false,
    default: () => 'CURRENT_TIMESTAMP',
    name: 'createdAt',
  })
  createdAt: Date;

  @Column('timestamp', {
    nullable: false,
    default: () => 'CURRENT_TIMESTAMP',
    name: 'updatedAt',
  })
  updatedAt: Date;
}
